package com.yanqu.road.entity.activity.platform;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_anti_fraud_user_data")
public class UserPlatformAntiFraudData extends DataObject {

    @FieldTypeAnnotation(select = true, update = true, desc = "玩家id")
    private long userId;

    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;

    @FieldTypeAnnotation(desc = "已领取档位")
    List<Integer> getReward = new ArrayList<>();

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public List<Integer> getGetReward() {
        return getReward;
    }

    public void setGetReward(List<Integer> getReward) {
        this.getReward = getReward;
    }

    public void addReward(int index){
        if(!getReward.contains(index)){
            getReward.add(index);
            setUpdateOption();
        }
    }
}
